package com.sx.manage.reserve.thread.threadpool.classify.cached;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.sx.manage.reserve.thread.threadpool.classify.Task;

/**
 * 可缓存多线程实例
 * 
 * @author Administrator
 *
 */
public class CacheThreadTest {

	public static void main(String[] args) {
		// 声明线程池
		ExecutorService executor = Executors.newCachedThreadPool();
		//执行多线程
		executor.execute(new Task());//参数为，继承thread或者实现runnable的类
		//关闭线程池，防止线程泄露
		executor.shutdown();
	}
}
